package com.itmayiedu.model.test;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;

import java.sql.Timestamp;

/**
 * Created by Devin on 2018/1/21.
 */
@CacheConfig(cacheNames = "baseCache")
public interface StudentMapper {
   @Select("SELECT * FROM st_student WHERE id = #{id}")
   @Cacheable
   Student findById(@Param("id") Integer id);

   @Insert("INSERT INTO st_student(`id`, `name`, `setx`, `create_time`) VALUES (null,#{name},#{sex},#{createTime});")
   int insert(@Param("name") String name, @Param("sex") String sex,@Param("createTime")Timestamp createTime);
}
